package com.yishu.user.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



/**
 * todo
 *
 * @author zengchao
 * @date 2021-06-29 23:49:27
 */
@RestController
@RequestMapping("discovery")
public class DiscoveryClientController {
    @Autowired
    private DiscoveryClient discoveryClient;

    /**
     * 获取服务列表
     * @return
     */
    @GetMapping("services")
    public Object get(){
        return discoveryClient.getServices();
    }

}
